Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
«Min side»: profile page with top 4, lists and reviews
Closes #73 .
Part 4 of the wine lists.
/mineis now «Min side»: who you are, your top 4, the newest wines on each list, and your reviews. Each list and the reviews have their own page with «Last inn flere»./kontois still where you log in and out.What's added
Fixed this #92 (comment) and updated .gitignore and removed unecessary .gitignore in /frontend.
Pages (all behind
RequireAuth, so visitors are sent to log in and come back)/mine– «Min side»: username and «Medlem siden …», «Topp 4», «Favoritter», «Vil prøve», «Har prøvd» (the 4 newest wines each, with «Se alle N …»), and «Mine dommer» (the 4 newest, with «Se alle N dommer»). Each part is asectionwith its ownh2, so screen reader users can jump between them with the heading keys./mine/favoritter,/mine/vil-proveand/mine/har-provd: the whole list, 24 at a time with «Last inn flere». Focus moves to the first new wine. An unknown list gives «Fant ikke listen» with a link back./mine/dommer: all your reviews, 10 at a time, with «Nyeste først» or «Eldste først». The order is kept in the URL (?sortering=eldste), so reload and the back button keep it.Top 4
aria-disabled(notdisabled, so it keeps focus) and says why.Reviews
User.reviews(order: NEWEST | OLDEST). The default isNEWEST, so existing queries work as before. Seedocs/api.md.Cache and data
User.winesis cached per list, andUser.reviewsper order. «Min side» (4 wines) and the list pages (24 wines) share the cache, and the list pages fetch again (cache-and-network), so they always show the whole list.Layout
Fixes after the review of #72
backend/src/lists/wine-lists.tsandfrontend/src/lib/wineLists.ts). Each now has a comment pointing to the other, so they are changed together.docs/vm.md(separate PR) and under «After merge» below.Commits
Tests
User.reviewswithOLDESTand paging,NEWESTas the default, and an error for an unknown order.e2e/profile.spec.ts, desktop and mobile): log in, add a favourite, choose the top 4 with the keyboard, see «Min side», log out. Also: a wine taken off the favourites leaves the top 4. axe on every step. The fake API is now shared between the e2e tests (e2e/support/).useWineList.test.tsxnow counts the requests sent instead of waiting for the answer, so it no longer depends on how fast the computer is.npm run checkpasses infrontend/, andnpm testpasses withTEST_DATABASE_URLinbackend/. Test counts are in the README.Manual testing
Followed section 9 in
docs/manual-testing.md:How to review
npm run db:migrateandnpm run db:seed:demo. Then start the frontend./mine/dommerwith both orders.After merge (VM)
The frontend asks for
orderonUser.reviews, which the old backend does not know. Update the backend first, as indocs/vm.md: pull,npm ci,npm run db:migrate, restart the backend, and check with curl. Then runnpm run buildvmfor the frontend.Not in this PR
docs/api.md: